@extends('backend::layout')
@section('title',$page_title)
@section('content')
    @if(isset($search))
        {{$search->render()}}
    @endif
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <div class="table-responsive">
                    <table class="list table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>
                                @component('backend::component.checkbox')
                                    @slot('name') ids-all @endslot
                                @endcomponent
                            </th>
                            <th>申请人</th>
                            <th>支付金额</th>
                            <th>申请级别</th>
                            <th>申请时间</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($list as $item)
                            <tr>
                                <td class="text-truncate">
                                    @component('backend::component.checkbox')
                                        @slot('name') id[] @endslot
                                        @slot('class') id @endslot
                                        @slot('value') {{$item->id}} @endslot
                                    @endcomponent
                                </td>
                                <td class="text-truncate text-more-hide">
                                    {{$item->user->user_number}}[{{$item->user->real_name}}]<br/>
                                    {{$item->user->user_phone}}
                                </td>
                                <td>
                                    金额:{{$item->pay_money}}<br/>
                                </td>
                                <td>
                                    级别:<br/>
                                    {{get_user_level($item->up_after_level)}}
                                </td>
                                <td>
                                    申请时间:{{$item->created_at}}<br/>
                                    @if($item->status!=1)
                                        处理时间:{{$item->updated_at}}
                                    @endif
                                </td>
                                <td>
                                    @switch($item->status)
                                        @case(2) 已审批 @break
                                        @case(3) 已拒绝 @break
                                        @default 待审核
                                    @endswitch
                                </td>
                                <td class="text-truncat mr-1">
                                    @component('backend::component.form.button')
                                        @slot('title') 详情 @endslot
                                        @slot('elem') a @endslot
                                        @slot('href') {{route('b_Up_detail',['id'=>$item->id])}} @endslot
                                        @slot('icon') hcl-wangye @endslot
                                        @slot('color') primary @endslot
                                    @endcomponent
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                    @slot('list_page')
                        {{$list->appends($search->getSearchData())->links('backend::public.pagination')}}
                    @endslot
                </div>
            @else
                @include('backend::public.empty_page',['info'=>'暂时没有升级申请'])
            @endif
        @endslot
    @endcomponent
@endsection